package comp302.prototype.slide;

import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

import comp302.prototype.MainWindow;

import java.awt.Font;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class AdditionItem extends JPanel {
	private static final long serialVersionUID = -3338970307163175734L;

	public AdditionItem() {
		super();
		setFocusable(true);
		setLayout(new BorderLayout(0, 0));
		JLabel lblNewLabel = new JLabel("+");
		lblNewLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 28));
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		add(lblNewLabel, BorderLayout.CENTER);

		addMouseListener(new MouseListener() {

			@Override
			public void mouseClicked(MouseEvent arg0) {
				SlideController sc = MainWindow.getSlideController();
				
				requestFocus();
				sc.show(sc.appendNew());
			}

			@Override
			public void mouseEntered(MouseEvent arg0) {
			}

			@Override
			public void mouseExited(MouseEvent arg0) {
			}

			@Override
			public void mousePressed(MouseEvent arg0) {
			}

			@Override
			public void mouseReleased(MouseEvent arg0) {
			}
		});
	}
}
